/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package it.polimi.games.gpicalculator;

import it.polimi.games.epkb.controller.ThresholdsJpaController;
import it.polimi.games.epkb.entityClasses.Thresholds;
import it.polimi.games.epkb.entityClasses.ThresholdsPK;
import java.math.BigDecimal;
import java.util.List;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;

/**
 *
 * @author plebani
 */
public class MioTest {

    
    public static void main(String args[]) {
        
        BigDecimal value = new BigDecimal(10);
        
        EntityManagerFactory emf = Persistence.createEntityManagerFactory("EPKB-PU");
        
        ThresholdsJpaController tc = new ThresholdsJpaController(emf);
        ThresholdsPK tPK = new ThresholdsPK();
        tPK.setIdComponent("CPU1");
        tPK.setIdGPIKPI("1");
        List<Thresholds> t = tc.findThresholdsEntities(); //findThresholds(tPK);

        for (Thresholds x: t) {
            
            System.out.println(x.getThresholdsPK().getIdGPIKPI());
            System.out.println(x.getThresholdsPK().getIdComponent());
        }
        
//        if ((value.compareTo(t.getEmergencyRangeHigh()) == 1) || (value.compareTo(t.getEmergencyRangeLow()) == -1)) {
//            System.out.println("rosso");
//        } else {
//            System.out.println("non rosso");
//        }
        
        
    }
    
}
